﻿#include "stdafx.h"
#include "$Proxy$.h"

namespace $RootNamespace$
{
	$Proxy$::$Proxy$()
	{
		m_pRealSubject = NULL;
	}
	void $Proxy$::$Request$()
	{
		//  'lazy initialization' 
		if (m_pRealSubject == NULL)
		{
			m_pRealSubject = new $RealSubject$();
		}
	
		m_pRealSubject->$Request$();
	}

	void $RealSubject$::Test()
	{
		// Create proxy and request a service 
		$Proxy$ *proxy = new $Proxy$();
		proxy->$Request$();
	}

	void $RealSubject$::$Request$()
	{
		std::cout << "Called $RealSubject$::$Request$()" << std::endl;
	}
}